//
//  HOPPopoverController.swift
//  WB01
//
//  Created by HOP on 16/1/3.
//  Copyright © 2016年 HOP. All rights reserved.
//

import UIKit

class HOPPopoverController: UIViewController {
    private var content: [String] = ["首页", "好友圈", "群微博", "我的微博", "新浪微博"]
    @IBOutlet weak var tabelView: UITableView!
    private let ReuseIdentifier = "ReuseIdentifier"
    override func viewDidLoad() {
        super.viewDidLoad()
        view.backgroundColor = UIColor.clearColor()
        prepareTableView()
       
    }
    private func prepareTableView() {
    // 设置数据源
        tabelView.dataSource = self
    // 注册cell
        tabelView.registerClass(UITableViewCell.self, forCellReuseIdentifier: ReuseIdentifier)
    
    
    }

   
}
// MARK: - 扩展
extension HOPPopoverController: UITableViewDataSource {
    func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        return content.count
    }
    func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
        let cell = tabelView.dequeueReusableCellWithIdentifier(ReuseIdentifier)!
        cell.textLabel?.text = content[indexPath.row]
        return cell
    }


}